.spWrapper {
    display: flex !important;
    flex: 1 0 100% !important;
}

.tpWrapper {
    display: flex !important;
    flex: 1 0 100%;
}

.spLayout {
    display: flex;
    width: 100%;
    flex: 1 0 100%;

    & > button {
        display: none;
        height: 3rem;
        color: #fff;
        background: var(--ifm-color-primary);
        border: none;
        border-radius: 0.5rem;
        text-transform: uppercase;
        font-weight: 700;
        font-family: var(--ifm-font-family-base);
        transition: background-color 0.12s ease-out;

        &:hover {
            background: #e96e97;
        }

        &:active {
            background: #c52359;
        }
    }

    &.tutorial {
        @media only screen and (max-width: 920px), (max-aspect-ratio: 5/4) {
            button {
                display: unset;
            }

            .editorWrapper {
                display: unset;
            }

            .previewWrapper {
                display: none;
            }

            &.showOutput {
                .editorWrapper {
                    display: none;
                }

                .previewWrapper {
                    display: flex;
                }
            }
        }

        @media only screen and (max-width: 1440px) {
            flex-direction: column;
        }
    }

    &.fullscreen {
        @media only screen and (max-width: 375px) {
            button {
                display: unset;
            }

            .editorWrapper {
                display: unset;
            }

            .previewWrapper {
                display: none;
            }

            &.showOutput {
                .editorWrapper {
                    display: none;
                }

                .previewWrapper {
                    display: flex;
                }
            }
        }

        @media only screen and (max-aspect-ratio: 1/1) {
            flex-direction: column;
        }
    }

    &.example {
        @media only screen and (max-width: 1280px) {
            flex-direction: column;
        }
    }

    .editorWrapper {
        flex: 1 1 !important;
        width: 100%;
        overflow: auto;

        // Hide scrollbar
        -ms-overflow-style: none;
        scrollbar-width: none;
        ::-webkit-scrollbar {
            display: none;
        }

        .spTabs {
            padding: 0;

            .spTabButton {
                position: relative;
                padding: 0 1rem;

                &::before {
                    content: '';
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    background: rgba(255, 255, 255, 0.1);
                    opacity: 0;
                    transition: opacity 0.1s ease-in-out;
                }

                &::after {
                    content: '';
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    width: 100%;
                    height: 0.25rem;
                    background: var(--ifm-color-primary);
                    opacity: 0;
                }

                &[data-active='true'] {
                    color: var(--ifm-color-primary);
                    cursor: default;
                    pointer-events: none;

                    &::after {
                        opacity: 1;
                    }
                }

                &[data-active='false'] {
                    &:hover {
                        &::before {
                            opacity: 1;
                        }
                    }
                }
            }
        }
    }

    .previewWrapper {
        position: relative;
        display: flex;
        flex: 1 1 !important;
    }
}

.sandpackLoadingOverlay {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: url(/static/images/logo-p.svg) center center no-repeat;
    z-index: 100;
    animation: 1s infinite alternate loadingPulse;
}

@keyframes loadingPulse {
    from {
        background-size: 20%;
        opacity: 0.7;
    }
    to {
        background-size: 23%;
        opacity: 1;
    }
}
